package com.eascs.banknet.boc.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.eascs.banknet.boc.vo.boc006.BOC006Element;
import com.eascs.banknet.common.dao.BaseO2oDao;
import com.eascs.common.util.StringUtil;

@Repository
public class BOC006Dao extends BaseO2oDao{
	public List<BOC006Element> queryData(String startId){
		StringBuffer sql = new StringBuffer();
		sql.append("SELECT t1.bank_applyno 'APPNO' FROM o2o_loan_user t1 WHERE t1.bank_status IN ('0109', '0149') ")
			.append(" AND NOT EXISTS ")
			.append("(SELECT 1 FROM o2o_prepayment_amount t2 WHERE t2.appno = t1.bank_applyno)")
			.append(" AND t1.bank_applyno IS NOT NULL");
		if(StringUtil.hasText(startId)){
			sql.append("   AND t1.bank_applyno > '").append(startId).append("' ");
		};
		sql.append(" ORDER BY t1.bank_applyno LIMIT 1");
		return super.findEntitys(sql.toString(), BOC006Element.class);
	}
	
	public String getPrepaymentByAppno(String appno){
		String sql = "SELECT prepaymentno FROM o2o_prepayment_amount WHERE appno = ?";
		return super.findString(sql, appno);
	} 
	
	public void updateInfo(String appno,String acctnew_in,String unduecorbal,String principal,String intrece,String arrearpia,
			String arreariia,String arrearipia,String totbalarr,String totbal,String accrual,String pia,String iia,String ipia,String totaccr,String trandate,String trantime) {
		String sql = "";
	}

}
